package xhwl.insurance.http.api;

import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.insurance.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by fuyi on 2017/11/28.
 */

public class VideoDetailRelatedApi extends BaseApi {

    VideoDetailRelateReq req;
    public VideoDetailRelatedApi(String member_id,String video_id,int page_num) {
        req = new VideoDetailRelateReq(member_id,video_id,page_num);

    }

    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).getVideoDetailRelated(requestBody);
    }

    class VideoDetailRelateReq {
        public String member_id;
        public String video_id;
        public int page_num;

        public VideoDetailRelateReq(String member_id, String video_id,int page_num){
            this.member_id = member_id;
            this.video_id = video_id;
            this.page_num = page_num;

        }
    }
}
